import request from "@/utils/httpInterceptor";
/** 任务处理API-审核通过请求参数 */
export interface ActivitiesTaskApproved {
  billId?: string;
  action?: string;
  comment?: string;
  taskId?: string;
  finalFlag?: string;
  formKey?: string;
  variables?: Record<string, string>;
  taskAttachmentList?: any[];
}

/** 任务处理API-审核通过请求参数 */
export type ApprovedType = "A" | "FA" | "R";

/** 审批信息 */
export const ApprovalInfo = [
  {
    title: "审核流程",
    key: "taskName",
    dataIndex: "taskName",
  },

  {
    title: "审核人",
    key: "assigneeName",
    dataIndex: "assigneeName",
  },
  {
    title: "审核状态",
    key: "taskApprovalStatusName",
    dataIndex: "taskApprovalStatusName",
  },
  {
    title: "审核时间",
    key: "assigneeProcessingTime",
    dataIndex: "assigneeProcessingTime",
  },
  {
    title: "审核意见",
    key: "assigneeComment",
    dataIndex: "assigneeComment",
  },
];
/** 任务处理API-查询用户待处理任务 */
export const postActivitiesPendingTaskList = (params: QueryList) =>
  request("/activiti/user/pending-task/list", {
    method: "POST",
    data: params,
    complete: () => {},
  });

/** 任务处理API-查询用户已处理任务 */
export const postActivitiesCompletedTaskList = (params: QueryList) =>
  request("/activiti/user/completed-task/list", {
    method: "POST",
    data: params,
    complete: () => {},
  });

/** 任务处理API-查询用户提交的申请 */
export const postActivitiesProcessTaskList = (params: QueryList) =>
  request("/activiti/user/process/list", {
    method: "POST",
    data: params,
    complete: () => {},
  });

/** 查询右上角的 通知数 */
export const noticeTotalNumber = () =>
  request("/activiti/user/taskQtyStat", {
    method: "POST",
    complete: () => {},
  });

/** 任务处理API-审核通过 */
export const postActivitiesTaskApproved = (params: ActivitiesTaskApproved) =>
  request("/activiti/user/task/approved", {
    method: "POST",
    data: params,
    complete: () => {},
  });

/** 任务处理API-审核不通过 */
export const postActivitiesTaskUnapproved = (params: ActivitiesTaskApproved) =>
  request("/activiti/user/task/unapproved", {
    method: "POST",
    data: params,
    complete: () => {},
  });
